]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
searchDisplay: Reset the keyboard focus after displaying async results
authorRui Matos <tiagomatos@gmail.com>
Sun, 29 Apr 2012 22:25:59 +0000 (00:25 +0200)
committerRui Matos <tiagomatos@gmail.com>
Sun, 29 Apr 2012 23:10:08 +0000 (01:10 +0200)
We hide the content around displaying new search results to prevent
flickering, unfortunately, one side effect of hiding an actor is
losing key focus if it currently is on the that actor or any
child. This could happen in the case of async results showing up after
the user had moved focus to the search results.

This patch works around that issue by saving the key focus and
resetting it back after displaying the new async results.

https://bugzilla.gnome.org/show_bug.cgi?id=675078

js/ui/searchDisplay.js

index 3c16e5656e641f4e52c402c49530a03b0d7ac358..c2185d9edc213e40bc9de9d52daabc71c7ea8822 100644 (file)
@@ -395,10 +395,17 @@ const SearchResults = new Lang.Class({
                     function(metas) {
                         this._clearDisplayForProvider(provider);
                         meta.actor.show();
+
+                        // Hinding drops the key focus if we have it
+                        let focus = global.stage.get_key_focus();
                         this._content.hide();
+
                         meta.resultDisplay.renderResults(metas);
                         this._maybeSetInitialSelection();
+
                         this._content.show();
+                        if (this._content.contains(focus))
+                            global.stage.set_key_focus(focus);
                     }));
             } else {
                 let metas = provider.getResultMetas(results);